import xlrd

class DumpExcel():
    def __init__(self, path):
        # 文件的路径
        self.path = path

    def dump_excel(self, name):
        # 打开excel表
        wkb = xlrd.open_workbook(self.path)
        # 获取工作簿
        sheet = wkb.sheet_by_name(name)
        # 获取总行数
        rows_nums = sheet.nrows
        cap = []
        for i in range(rows_nums):
            x = sheet.row_values(i)
            cap.append(x)
        return cap
